<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html>
<head>
  <title>上传与下载文件</title>
  <style type="text/css">
    table {
      border-collapse: collapse;
      border: 1px solid
    }
    td {
      border: 1px solid
    }
  </style>
</head>
<body>
<fieldset>
  <legend>上传文件</legend>
  <s:form action="file-upload!upload" enctype="multipart/form-data" method="post">
    <s:file name="object" key="label0" />
    <s:submit value="%{getText('label1')}" />
  </s:form>
</fieldset>
<table align="center" style="text-align: center; width: 70%">
  <tr>
    <th style="width: 75px"><s:text name="label2" /></th>
    <th><s:text name="label3" /></th>
    <th style="width: 150px"><s:text name="label4" /></th>
    <th style="width: 100px"><s:text name="label5" /></th>
  </tr>
  <s:if test="files().length>0">
    <s:iterator value="files()" var="obj" status="mark">
      <s:if test="#obj!=null">
        <tr>
          <td><s:property value="#mark.count" /></td>
          <td><s:property value="#obj.name" /></td>
          <td><s:property value="#obj.length" /></td>
          <td>
            <s:a href="file-uploaded!download?objectFileName=%{#obj.name}"><s:text name="label6" /></s:a>
            <br>
            <s:a href="uploaded/%{#obj.name}"><s:text name="label7" /></s:a>
            <br>
            <s:a href="file-uploaded!delete?objectFileName=%{#obj.name}"><s:text name="label8" /></s:a>
          </td>
        </tr>
      </s:if>
    </s:iterator>
  </s:if>
</table>
</body>
</html>
